package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysNoticesMapper;
import com.ruoyi.system.domain.SysNotices;
import com.ruoyi.system.service.ISysNoticesService;

/**
 * 通知公告Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-20
 */
@Service
public class SysNoticesServiceImpl implements ISysNoticesService 
{
    @Autowired
    private SysNoticesMapper sysNoticesMapper;

    /**
     * 查询通知公告
     * 
     * @param noticeId 通知公告主键
     * @return 通知公告
     */
    @Override
    public SysNotices selectSysNoticesByNoticeId(Long noticeId)
    {
        return sysNoticesMapper.selectSysNoticesByNoticeId(noticeId);
    }

    /**
     * 查询通知公告列表
     * 
     * @param sysNotices 通知公告
     * @return 通知公告
     */
    @Override
    public List<SysNotices> selectSysNoticesList(SysNotices sysNotices)
    {
        return sysNoticesMapper.selectSysNoticesList(sysNotices);
    }

    /**
     * 新增通知公告
     * 
     * @param sysNotices 通知公告
     * @return 结果
     */
    @Override
    public int insertSysNotices(SysNotices sysNotices)
    {
        sysNotices.setCreateTime(DateUtils.getNowDate());
        return sysNoticesMapper.insertSysNotices(sysNotices);
    }

    /**
     * 修改通知公告
     * 
     * @param sysNotices 通知公告
     * @return 结果
     */
    @Override
    public int updateSysNotices(SysNotices sysNotices)
    {
        sysNotices.setUpdateTime(DateUtils.getNowDate());
        return sysNoticesMapper.updateSysNotices(sysNotices);
    }

    /**
     * 批量删除通知公告
     * 
     * @param noticeIds 需要删除的通知公告主键
     * @return 结果
     */
    @Override
    public int deleteSysNoticesByNoticeIds(Long[] noticeIds)
    {
        return sysNoticesMapper.deleteSysNoticesByNoticeIds(noticeIds);
    }

    /**
     * 删除通知公告信息
     * 
     * @param noticeId 通知公告主键
     * @return 结果
     */
    @Override
    public int deleteSysNoticesByNoticeId(Long noticeId)
    {
        return sysNoticesMapper.deleteSysNoticesByNoticeId(noticeId);
    }
}
